package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.service.TbTypeTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbTypeTemplateServiceImpl implements TbTypeTemplateService {
    @Autowired
    private TbTypeTemplateMapper tbTypeTemplateMapper;
    @Override
    public List<TbTypeTemplate> selectAll() {
        List<TbTypeTemplate> tbTypeTemplates = tbTypeTemplateMapper.selectByExample(null);
        return tbTypeTemplates;
    }

    @Override
    public void addAll(TbTypeTemplate tbTypeTemplate) {
        tbTypeTemplateMapper.insertSelective(tbTypeTemplate);
    }

    @Override
    public TbTypeTemplate updateType(Long id) {
        TbTypeTemplate tbTypeTemplate = tbTypeTemplateMapper.selectByPrimaryKey(id);
        return tbTypeTemplate;
    }

    @Override
    public void updateTypeInfo(TbTypeTemplate tbTypeTemplate) {
        tbTypeTemplateMapper.updateByPrimaryKeySelective(tbTypeTemplate);
    }

    @Override
    public void deleteById(Long id) {
        tbTypeTemplateMapper.deleteByPrimaryKey(id);
    }
}
